package cn.iocoder.yudao.module.member.controller.app.project;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.member.controller.app.project.vo.AppProjectRespVO;
import cn.iocoder.yudao.module.member.convert.project.AppProjectConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.project.AppProjectDO;
import cn.iocoder.yudao.module.member.service.project.AppProjectService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

import java.util.List;

@Tag(name = "用户 App - 社交用户")
@RestController
@RequestMapping("/project")
@Validated
public class AppProjectController {

    @Resource
    private AppProjectService appProjectService;

    @GetMapping("/list")
    @Operation(summary = "获得项目列表")
    public CommonResult<List<AppProjectRespVO>> list() {
        List<AppProjectDO> projectList = appProjectService.getProjectList();
        return CommonResult.success(AppProjectConvert.INSTANCE.convertList(projectList));
    }

}
